package zhongbo.java.fast.order.model;

import cn.hutool.core.util.StrUtil;
import lombok.Data;
import zhongbo.java.fast.order.enums.OrderStatus;

import java.time.LocalDateTime;
import java.util.List;

// 订单类
@Data
public class Order {
    private String orderId;
    private List<Item> items;
    private OrderStatus status;
    private double totalPrice;
    private LocalDateTime createTime;
    // 构造方法/getter/setter

    // 订单备注
    private String remark;

    /**
     * 追加备注
     *
     * @param remark 备注
     */
    public void appendRemark(String remark) {
        if (StrUtil.isBlank(this.remark)) {
            this.remark = remark;
        }
        this.remark = this.remark + "\n" + remark;
    }
}